International Publication No. WO2011/138832 discloses a semiconductor device that has an IGBT and a diode provided in the same semiconductor substrate. Moreover, aside from a main IGBT through which a main current flows, a sense IGBT through which a smaller current flows is provided in this semiconductor substrate. By detecting the current that flows through the sense IGBT, it is possible to detect a current that flows through the main IGBT. Moreover, aside from the main diode through which a main current flows, a sense diode through which a smaller current flows is provided in this semiconductor substrate. Moreover, by detecting the current that flows through the sense diode, it is possible to detect a current that flows through the main diode.